home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 562 b | 32 lines | [TEXT/CWIE] |
- // Modifier.h
-
- #ifndef Modifier_h
- #define Modifier_h
-
- #ifndef Announcing_h
- #include "Announcing.h"
- #endif
-
- template < class ValueType >
- class Modifier
- {
- private:
- Announcing<ValueType>& target;
-
- // not implemented:
- Modifier( const Modifier& )
- void operator=( const Modifier& )
-
- public:
- Modifier( Announcing<ValueType>& theTarget )
- : target( theTarget )
- {}
-
- ~Modifier() { target.Announce(); }
-
- ValueType& operator*() const { return target.value; }
- ValueType *operator->() const { return &target.value; }
- };
-
- #endif
-